<link href="<@sp.static/>/assets/plugins/bootstrap/css/bootstrap.min.css?v=1.0.0" rel="stylesheet"/>
<link href="<@sp.static/>/assets/css/style.min.css?v=1.0.0" rel="stylesheet"/>
<link href="<@sp.static/>/css/style.css?v=1.0.0" rel="stylesheet"/>
<link href="<@sp.static/>/assets/plugins/datatables/css/data-table.css?v=1.0.0" rel="stylesheet"/>
<div style="overflow: auto; height: 450px; position: relative; margin: 8px;">
    <div class="panel panel-inverse" data-sortable-id="form-stuff-5">
        <div class="panel-body">
            <form class="form-horizontal do-confirm-form" id="confirmForm" name="confirmForm" action="" method="post">
                <input type="hidden" id="userCouponId" name="userCouponId" value="${couponInfo.id}">
                <input type="hidden" id="code" name="code" value="${couponInfo.code}">
                <div class="form-group m-l-10">
                    <label class="col-md-2 control-label">名称</label>
                    <div class="col-md-10">
                        <span class="form-control info name">${couponInfo.name}</span>
                    </div>
                </div>
                <div class="form-group m-l-10">
                    <label class="col-md-2 control-label">面额</label>
                    <div class="col-md-10">
                        <span class="form-control info">${couponInfo.amount}元</span>
                    </div>
                </div>
                <div class="form-group m-l-10">
                    <label class="col-md-2 control-label">有效期</label>
                    <div class="col-md-10">
                        <span class="form-control info">${couponInfo.effectiveDate}</span>
                    </div>
                </div>
                <div class="form-group m-l-10">
                    <label class="col-md-2 control-label">说明</label>
                    <div class="col-md-10">
                        <div class="form-control info desc">
                            ${couponInfo.description}
                        </div>
                    </div>
                </div>
                <div class="form-group m-l-10">
                    <label class="col-md-2 control-label">备注</label>
                    <div class="col-md-10">
                        <input type="text" class="form-control remark" id="remark" name="remark" placeholder="核销备注" value="">
                    </div>
                </div>
                <div class="form-group m-l-10">
                    <label class="col-md-2 control-label"></label>
                    <div class="col-md-10">
                        <button type="button" id="submitButton" class="btn btn-sm btn-danger">确认核销</button>
                    </div>
                </div>
            </form>
     </div>
    </div>
</div>
<!-- jquery -->
<script src="<@sp.static/>/js/jquery/jquery-3.0.0.min.js?v=1.0.0" type="text/javascript" charset="UTF-8"></script>
<script src="<@sp.static/>/js/jquery/validation/jquery.validate.min.js?v=1.0.0" type="text/javascript" charset="UTF-8"></script>
<script src="<@sp.static/>/assets/plugins/jquery-ui/ui/minified/jquery-ui.min.js?v=1.0.0"></script>
<script src="<@sp.static/>/assets/plugins/bootstrap/js/bootstrap.min.js?v=1.0.0"></script>
<script src="<@sp.static/>/js/layer/layer.js?v=1.0.0" type="text/javascript" charset="UTF-8"></script>
<script src="<@sp.static/>/js/custom/util.js?v=1.0.0" type="text/javascript" charset="UTF-8"></script>
<script src="<@sp.static/>/js/custom/message.js?v=1.0.0" type="text/javascript" charset="UTF-8"></script>
<script src="<@sp.static/>/js/custom/send.js?v=1.0.0" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript" language="JavaScript">
    $(function () {
        $('#submitButton').click(function () {
            layer.confirm('确定核销吗？', {
                btn: ['确定']
            }, function () {
                $.ajax({
                    type: "POST",
                    data:{"userCouponId": $("#userCouponId").val(), "code": $("#code").val(), "remark": $("#remark").val()},
                    url: "${rc.contextPath}/backend/doConfirm/doConfirm",
                    success: function (data) {
                        if (data.result) {
                            layer.alert("核销成功！");
                            return;
                        } else {
                            layer.alert(data.msg);
                            return;
                        }
                    }
                })
                $.close();
            }, function () {
                $.close();
            });
        });
    })
</script>